'use strict'

function getBlogList(){
    return new Promise(function(resolve,rejec){
        $.get(`http://localhost:8000/blog`,data=>{
            resolve(data)
        })
    })
}
function getBlogById(id){
    return new Promise(function(resolve,rejec){
        $.get(`http://localhost:8000/blog/${id}'`,data=>{
            resolve(data)
        })
    })
}
function delBlogById(id){
    return new Promise(function(resolve,rejec){
        $.ajax({
            url:`http://localhost:8000/blog/${id}`,
            type:ddelete,
            success:data=>{
                resolve(data)
            }
        })
    })
}

function postBlogById(id){
    return new Promise(function(resolve,rejec){
        $.post(`http://localhost:8000/blog/${id}'`,data=>{
            resolve(data)
        })
    })
}
function PutBlogById(id){
    return new Promise(function(resolve,rejec){
        $.get(`http://localhost:8000/blog/${id}'`,data=>{
            resolve(data)
        })
    })
}
